import ibm.cognos.imt.CogReport
import ibm.cognos.imt.DataItem
/**
 * Created by eric on 8/31/2014.
 */

class MyReport1 extends CogReport {

    def revenueFact = dataItem("[Sales (query)].[Sales].[Revenue]") {
        dataUsage = 'fact'
        dataType = DataItem.DECIMAL
        aggregate = "average"
    }

    def year = dataItem("[Sales (query)].[Time].[Year]")
    def list2 = list([revenueFact, year]).filter("[Year]=2000")

    def desc() {
        list2
    }

}

println(new MyReport1()
        .modelPath("/content/folder[@name='Samples']/folder[@name='Models']/package[@name='GO Sales (query)']/model[@name='model']")
        .getSpec())